package cn.broadsense.convert;

import cn.broadsense.biz.domain.Channel;
import cn.broadsense.thrid.result.ChannelResult;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

/**
 * @author: pengxin
 * @create: 2023-09-14 10:41
 * @Version 1.0
 **/

@Mapper(componentModel = "spring")
public interface ChannelConvertSync {

    @Mappings({
            @Mapping( target = "syncTime",expression = "java(Transform.currentTime())"),
            @Mapping( target = "ipAddress",source = "ipv4"),
    }
    )
    Channel toChannelDevice(ChannelResult result);


    List<Channel> toChannelDevices(List<ChannelResult> resultList);

}
